class QualityClass {
  String? createBy;
  DateTime? createTime;
  String? updateBy;
  DateTime? updateTime;
  String? remark;
  int? id;
  int historyId;
  String? sourceId;
  String? pdiId;
  String? furnaceNo;
  DateTime? chargingTime;
  DateTime? dischargingTime;
  int? dischargeCycle;
  String? name;
  double? width;
  double? thickness;
  double? aLength;
  String? rTypeC;
  double? aWeight;
  double? initTemp;
  double? node1Temp;
  double? node2Temp;
  double? node3Temp;
  double? node4Temp;
  double? node5Temp;
  double? node6Temp;
  double? node7Temp;
  String? pdiNo;
  String? shift;
  String? team;
  String? companyId;
  String? field01;
  String? field02;
  String? field03;

  QualityClass({
    this.createBy,
    this.createTime,
    this.updateBy,
    this.updateTime,
    this.remark,
    this.id,
    required this.historyId,
    this.sourceId,
    this.pdiId,
    this.furnaceNo,
    this.chargingTime,
    this.dischargingTime,
    this.dischargeCycle,
    this.name,
    this.width,
    this.thickness,
    this.aLength,
    this.rTypeC,
    this.aWeight,
    this.initTemp,
    this.node1Temp,
    this.node2Temp,
    this.node3Temp,
    this.node4Temp,
    this.node5Temp,
    this.node6Temp,
    this.node7Temp,
    this.pdiNo,
    this.shift,
    this.team,
    this.companyId,
    this.field01,
    this.field02,
    this.field03,
  });

  factory QualityClass.fromJson(Map<String, dynamic> json) {
    return QualityClass(
      createBy: json['createBy'] as String?,
      createTime: DateTime.tryParse(json['createTime'] as String? ?? ''),
      updateBy: json['updateBy'] as String?,
      updateTime: DateTime.tryParse(json['updateTime'] as String? ?? ''),
      remark: json['remark'] as String?,
      id: json['id'] as int?,
      historyId: json['historyId'] as int,
      sourceId: json['sourceId'] as String?,
      pdiId: json['pdiId'] as String?,
      furnaceNo: json['furnaceNo'] as String?,
      chargingTime: DateTime.tryParse(json['chargingTime'] as String? ?? ''),
      dischargingTime:
          DateTime.tryParse(json['dischargingTime'] as String? ?? ''),
      dischargeCycle: json['dischargeCycle'] as int?,
      name: json['name'] as String?,
      width: (json['width'] as num?)?.toDouble(),
      thickness: (json['thickness'] as num?)?.toDouble(),
      aLength: (json['aLength'] as num?)?.toDouble(),
      rTypeC: json['rTypeC'] as String?,
      aWeight: (json['aWeight'] as num?)?.toDouble(),
      initTemp: (json['initTemp'] as num?)?.toDouble(),
      node1Temp: (json['node1Temp'] as num?)?.toDouble(),
      node2Temp: (json['node2Temp'] as num?)?.toDouble(),
      node3Temp: (json['node3Temp'] as num?)?.toDouble(),
      node4Temp: (json['node4Temp'] as num?)?.toDouble(),
      node5Temp: (json['node5Temp'] as num?)?.toDouble(),
      node6Temp: (json['node6Temp'] as num?)?.toDouble(),
      node7Temp: (json['node7Temp'] as num?)?.toDouble(),
      pdiNo: json['pdiNo'] as String?,
      shift: json['shift'] as String?,
      team: json['team'] as String?,
      companyId: json['companyId'] as String?,
      field01: json['field01'] as String?,
      field02: json['field02'] as String?,
      field03: json['field03'] as String?,
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'createBy': createBy,
      'createTime': createTime?.toIso8601String(),
      'updateBy': updateBy,
      'updateTime': updateTime?.toIso8601String(),
      'remark': remark,
      'id': id,
      'historyId': historyId,
      'sourceId': sourceId,
      'pdiId': pdiId,
      'furnaceNo': furnaceNo,
      'chargingTime': chargingTime?.toIso8601String(),
      'dischargingTime': dischargingTime?.toIso8601String(),
      'dischargeCycle': dischargeCycle,
      'name': name,
      'width': width,
      'thickness': thickness,
      'aLength': aLength,
      'rTypeC': rTypeC,
      'aWeight': aWeight,
      'initTemp': initTemp,
      'node1Temp': node1Temp,
      'node2Temp': node2Temp,
      'node3Temp': node3Temp,
      'node4Temp': node4Temp,
      'node5Temp': node5Temp,
      'node6Temp': node6Temp,
      'node7Temp': node7Temp,
      'pdiNo': pdiNo,
      'shift': shift,
      'team': team,
      'companyId': companyId,
      'field01': field01,
      'field02': field02,
      'field03': field03,
    };
  }
}
